package org.levintech.javademo.g3noop;

/**
 * @author levin
 * Created on 2021/6/17
 * [雷学委] CSDN/Juejin Code Demo
 */
public class G3AndOOPDemo {
    public static void main(String[] args) {
        System.out.println("【雷学委代码Demo】");
        EarnMoney wz = new WangZong();
        EarnMoney wzSon = new XiaoWang01();
        EarnMoney wzDaughter = new XiaoWang02();
        System.out.println("王总的生财之道:" + wz.earnW());
        System.out.println("王总儿子的生财之道:" + wzSon.earnW());
        System.out.println("王总女儿的生财之道:" + wzDaughter.earnW());
        System.out.println("------------demo 一下继承 ------------");
        System.out.println("王总资产：" + ((WangZong) wz).saving());
        System.out.println("儿子继承的资产：" + ((WangZong) wzSon).saving());
        System.out.println("女儿继承资产：" + ((WangZong) wzDaughter).saving());
        System.out.println("------------宣布一下遗嘱 ------------");
        System.out.println("王总遗嘱：" + ((WangZong) wz).testament());
    }
}
